<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>评价列表</title>
    <script src="/js/global.js"></script>
    <link rel="stylesheet" href="/css/font.css" type="text/css"/>
    <link rel="stylesheet" href="/css/layui.css" type="text/css"/>
    <link rel="stylesheet" href="/css/xadmin.css" type="text/css"/>
    <script type="text/javascript" src="/js/layui.js"></script>
    <script type="text/javascript" src="/js/xadmin.js"></script>
    <script type="text/javascript" src="/js/jquery-3.5.1.min.js"></script>
</head>
<body>
<input type="text" name="id" id="id" style="display: none;">
<!-- 表格 -->
<table id="test" class="layui-hide" lay-filter="test"></table>

<script>
    layui.use(['layer', 'table', 'form', 'transfer', 'util', 'laydate'], function () {
        var table = layui.table;
        var $ = layui.jquery;
        var form = layui.form;
        var transfer = layui.transfer;
        var util = layui.util;
        var laydate = layui.laydate;


        initDate();

        function initDate(){
            //初始化表格数据
            table.render({
                elem: '#test',
                url: '../evaluation/selectAll',
                method: "get",
                where: {
                    goodsid: $("#id").val()
                },
                title: '评价列表',
                page: true,
                id: 'testReload',
                //修改响应数据
                parseData: function (res) {
                    return {
                        "code": 0, //解析接口状态
                        "msg": res.msg, //解析提示文本
                        "count": res.data.count, //解析数据长度
                        "data": res.data.data //解析数据列表
                    };
                },
                cols: [
                    [
                        {
                            field: 'adminname',
                            title: '评价人',
                            align: 'center'
                        }, {
                        field: 'content',
                        title: '评价内容',
                        align: 'center'
                    }, {
                        field: 'score',
                        title: '评分',
                        align: 'center'
                    }, {
                        field: 'time',
                        title: '时间',
                        align: 'center'
                    }
                    ]
                ]
            });

        }

    });
</script>
</body>
</html>
